Folder Path Expression
When loading the data flow into a file target, you'll need to provide a folder path where the file produced will be saved. This folder path can be a static value, or a dynamic PQL expression.
This lets you load file outputs into a new folder labeled by the given expression. This is commonly used to create date time folders, or to label the folder by the current user. It can also be used to append a variable to the folder path and name the folder according to that variable.
In this example, a dynamic PQL expression is provided to point to a shared CSV folder path to append the date to the file path.
The Expression checkbox was enabled and the following folder path expression given:
"\\Server1\temp\"+Date()
The CSV file outputs are loaded into the new Date folder:
In this example, a dynamic PQL expression is provided to point to a shared Parquet folder path to append the value of the given variable to the file path.
The Master Flow is opened, and the SQL Script node connected to the Data Flow node. The following script is injected into the SQL node (green arrow bellow):
select max(dates) as MaxDate from dates
The results of this expression are then loaded into the variable (blue highlight below).
When the Master Flow runs, the SQL script will return the last date, which will be injected into the variable.
Next, the following expression is given for the shared folder path:
"\\Server1\Sales\Prod"+@Variable_LastDate
When the Data Flow runs, the value of the last date variable will be appended to the folder path: